%let NumSample=100; %let SampleSize=10000; %let lambda=3; data pois; call streaminit(7777); do sample=1 to &NumSample; do n=1 to &SampleSize; po=rand("Poisson",&lambda); output; end; end; run; proc sgplot data=pois; histogram po; run; quit; proc means data=pois noprint mean; class sample; output out=pois_means(where=( _TYPE_=1 & _STAT_='MEAN')); run; proc print data=pois_means; run; title 'Sampling distribution of the mean'; proc sgplot data=pois_means; histogram po / scale=count; density po / type=normal; run; title;